import { http } from '@/utils/http/axios';

export interface GetMenuListData {
  menuCode: string;
  menuNameZh: string;
  status: number;
}

/**
 * @description: 根据用户id获取用户菜单
 */
export function adminMenus() {
  return http.request({
    url: '/menus',
    method: 'GET',
  });
}

/**
 *
 * @description: 获取tree菜单列表
 */
export function getMenuList(data={}) {
  return http.request({
    url: '/admin/account/permmenu',
    method: 'get',
    data,
  });
}

/**
 *
 * @description: 初始化菜单
 */
export const initTree = (data = {}) => {
  return http.request({
    url: `/admin/sys/menu/initMenu`,
    method: 'POST',
    data,
  });
};

/**
 * 删除所有菜单
 * @description: 删除所有菜单
 */
export const removeAllMenu = () => {
  return http.request({
    url: `/msp/permission/remove/all`,
    method: 'delete',
  });
};

/**
 *
 * @description: 删除菜单
 */
export const removeMenu = (id) => {
  return http.request({
    url: `/uc/permission/remove`,
    method: 'delete',
    params: { id },
  });
};

/**
 *
 * @description: 查询菜单下拉树结构
 */
export function getMenuTreeselect(data = {}) {
  return http.request({
    url: '/uc/permission/treeMsp',
    method: 'post',
    data,
  });
}
